package avicit.bdp.dms.tdm.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

@ApiModel(value = "BdpAssetMountReportDTO", description = "资产挂载报表")
@Table(name = "bdp_asset_mount_report")
public class BdpAssetMountReportDTO extends BaseDTO {
  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @LogField
  @ApiModelProperty(value = "主键")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @Column(name = "id")
  @avicit.platform6.core.annotation.log.Id
  @javax.persistence.Id
  private String id;

  /** 数据资产id */
  @LogField
  @ApiModelProperty(value = "数据资产id", name = "assetId")
  @FieldRemark(column = "asset_id", field = "assetId", name = "数据资产id")
  private String assetId;

  /** 资源类型[1-数据服务/2-文档/3-报表分析/4-模型] */
  @LogField
  @ApiModelProperty(value = "资源类型[1-数据服务/2-文档/3-报表分析/4-模型]", name = "assetType")
  @FieldRemark(column = "asset_type", field = "assetType", name = "资源类型[1-数据服务/2-文档/3-报表分析/4-模型]")
  private String assetType;

  /** 报表URL */
  @LogField
  @ApiModelProperty(value = "报表URL", name = "reportUrl")
  @FieldRemark(column = "report_url", field = "reportUrl", name = "报表URL")
  private String reportUrl;

  /** 开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表] */
  @LogField
  @ApiModelProperty(
      value = "开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表]",
      name = "openServiceType")
  @FieldRemark(
      column = "open_service_type",
      field = "openServiceType",
      name = "开放服务类型[1-数据查询/2-数据推送/3-API接口/4-下载/5-模型/6-报表]")
  private String openServiceType;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getAssetId() {
    return assetId;
  }

  public void setAssetId(String assetId) {
    this.assetId = assetId;
  }

  public String getAssetType() {
    return assetType;
  }

  public void setAssetType(String assetType) {
    this.assetType = assetType;
  }

  public String getReportUrl() {
    return reportUrl;
  }

  public void setReportUrl(String reportUrl) {
    this.reportUrl = reportUrl;
  }

  public String getOpenServiceType() {
    return openServiceType;
  }

  public void setOpenServiceType(String openServiceType) {
    this.openServiceType = openServiceType;
  }


  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "资产-分析报表";
    } else {
      return super.logFormName;
    }
  }

  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "资产-分析报表";
    } else {
      return super.logTitle;
    }
  }

}
